//
//  PersonViewController.m
//  07-拉钩作业-tabBarController
//
//  Created by 王道林 on 16/7/23.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import "PersonViewController.h"
#import "ViewController.h"
@interface PersonViewController ()

@end

@implementation PersonViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view.
    [self createSubView];
    
}

- (void)createSubView
{
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(200, 300, 100, 50);
    button.center = self.view.center;
    [button setTitle:@"登陆" forState:UIControlStateNormal];
    button.titleLabel.font = [UIFont systemFontOfSize:40];
    button.backgroundColor = [UIColor redColor];
    [self.view addSubview:button];
    [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
}

- (void)buttonAction:(UIButton *)button
{
    ViewController *VC = [[ViewController alloc] init];
    [self presentViewController:VC animated:YES completion:nil];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
